package xyz.mumuwei.youthcourseserver.common.lang;

/**
 * 全局常量对象
 * @author mumuwei
 */
public class Const {

    public final static Integer TOP_AUTHORITY = 10;

    /**
     * token有效时间 1小时
     */
    public final static long TOKEN_EXPIRE_TIME = 60 * 60 * 1000;

    /**
     * token密钥
     */
    public final static String TOKEN_KEY = "mumuweinfdqwiuALSDFuhbcikueysgfvUYGKU";

    /**
     * 允许不携带token访问路径
     */
    public final static String[] EXCLUDE_PATH = {
            "/test",
            "/captcha/*",
            "/login/**",
            "/valid*",
            "/register/**",
            "/getEmail",
            "/getEmailCode",
            "/avatar/**",
            "/static/**",
            "/order/pcAlipayReturn",
            "/order/wapAlipayReturn",
            "/order/alipayNotify",
            "/course/classify",
            "/course/page/type",
            "/course/cs/**",
            "/teacher/course/*",
            "/evaluate/course/*",
            "/course/pay/*",
            "/send/*",
            "/order/gotoWapAlipay",
            "/js/**"
    };

    public final static String USERNAME = "YCMS";

    public final static Integer PARAM_FAIL_CODE = 401;
    public final static String PARAM_FAIL_MSG = "请求的携带参数有误";

    public final static Integer AUTHOR_FAIL_CODE = 403;
    public final static String AUTHOR_FAIL_MSG = "权限不足";

    public final static Integer LOCK_CODE = 506;
    public final static String LOCK_MSG = "账号被锁定，请联系管理员！";
    public final static Integer ILLEGAL_TOKEN_CODE = 508;
    public final static String ILLEGAL_TOKEN_MSG = "非法Token!";
    public final static Integer OTHER_LOGIN_CODE = 512;
    public final static String OTHER_LOGIN_MSG = "其他客户端登录！";
    public final static Integer EXPIRED_TOKEN_CODE = 514;
    public final static String EXPIRED_TOKEN_MSG = "Token过期,请重新登录！";

    public final static Integer STUDENT_ROLE_CODE = 1002;
    public final static Integer TEACHER_ROLE_CODE = 1003;

    public final static Integer USERNAME_MIN_SIZE = 6;

    public final static String TOKEN_WECHAT_HEAD_REDIS = "wechat:token";
    public final static String EMAIL_CODE_HEAD_REDIS = "email:code:";
    public final static String PHONE_CODE_HEAD_REDIS = "phone:code:";
    public final static String TOKEN_CODE_HEAD_REDIS = "user:token:";
    public final static String USER_PAY_ORDER_REDIS = "order:create:pay:";

    public final static Integer PAY_CASH_CODE = 0;
    public final static Integer PAY_ALIPAY_CODE = 1;
    public final static Integer PAY_WECHAT_CODE = 2;

    public final static Integer ORDER_STATE_SUCCESS = 0;
    public final static Integer ORDER_STATE_WAIT = 1;
    public final static Integer ORDER_STATE_REFUND = 2;
    public final static Integer ORDER_STATE_CANCLE = 3;

    public final static String ALIPAY_SUCESS = "TRADE_SUCCESS";
    public final static String ALIPAY_WAIY = "WAIT_BUYER_PAY";
    public final static String ALIPAY_CLOSE = "TRADE_CLOSED";
    public final static String ALIPAY_FINISH = "TRADE_FINISHED";

    public final static String MINI_PROGRAM_STATE_WECHAT = "developer";
    public final static String PAY_WECHAT_TEMPLATE_ID = "HJ2E2KIjz1HWdZDFVA0nsv9JPZg2bC3UFsD2gRcZQUs";
    public final static String CLASS_WECHAT_TEMPLATE_ID = "8VLTzNvhNnAp_SfUz3JJuFJEEcNkCjf5oJXVMi_QkMk";

    public final static long ORDER_REFRESH_DELAY = 60*60*2;
}

